package com.jeason.blogmpg.entity;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 博客表
 * </p>
 *
 * @author jeason
 * @since 2021-01-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_blog")
@ApiModel(value="Blog对象", description="博客表")
public class Blog implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "唯一uid")
    @TableId(value = "uid", type = IdType.UUID)
    private String uid;

    @ApiModelProperty(value = "博客标题")
    private String title;

    @ApiModelProperty(value = "博客简介")
    private String summary;

    @ApiModelProperty(value = "博客内容")
    private String content;

    @ApiModelProperty(value = "标签uid")
    private String tagUid;

    @ApiModelProperty(value = "博客点击数")
    private Integer clickCount;

    @ApiModelProperty(value = "博客收藏数")
    private Integer collectCount;

    @ApiModelProperty(value = "标题图片uid")
    private String fileUid;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "管理员uid")
    private String adminUid;

    @ApiModelProperty(value = "是否原创（0:不是 1：是）")
    private String isOriginal;

    @ApiModelProperty(value = "作者")
    private String author;

    @ApiModelProperty(value = "文章出处")
    private String articlesPart;

    @ApiModelProperty(value = "博客分类UID")
    private String blogSortUid;

    @ApiModelProperty(value = "推荐等级(0:正常)")
    private Integer level;

    @ApiModelProperty(value = "是否发布：0：否，1：是")
    private String isPublish;

    @ApiModelProperty(value = "排序字段")
    private Integer sort;

    @ApiModelProperty(value = "是否开启评论(0:否 1:是)")
    private String openComment;

    @ApiModelProperty(value = "类型【0 博客， 1：推广】")
    private String type;

    @ApiModelProperty(value = "外链【如果是推广，那么将跳转到外链】")
    private String outsideLink;

    @ApiModelProperty(value = "唯一oid")
    private Integer oid;

// 以下字段不存入数据库，封装为了方便使用

    /**
     * 标签,一篇博客对应多个标签
     */
    @TableField(exist = false)
    private List<Tag> tagList;

    /**
     * 标题图
     */
    @TableField(exist = false)
    private List<String> photoList;

    /**
     * 博客分类
     */
    @TableField(exist = false)
    private BlogSort blogSort;

    /**
     * 博客分类名
     */
    @TableField(exist = false)
    private String blogSortName;

    /**
     * 博客标题图
     */
    @TableField(exist = false)
    private String photoUrl;

    /**
     * 点赞数
     */
    @TableField(exist = false)
    private Integer praiseCount;

    /**
     * 版权申明
     */
    @TableField(exist = false)
    private String copyright;
}
